package com.bowen.chapter01.refactor;

import com.bowen.except.SubclassResponsibilityException;

public class Employee {


    /**
     * 获得年度总消耗
     *
     * @return
     */
    public float getAnnualCost() throws SubclassResponsibilityException {
        return this.getMonthlyCost() * 12;
    }


    /**
     * 在JavaScript中 父类不用实现 getMonthlyCost 方法，只要子类实现也不会报错
     * 获得月度消耗值
     *
     * @return
     * @throws
     */
    public float getMonthlyCost() throws SubclassResponsibilityException {
        throw new SubclassResponsibilityException();
    }
}
